<?php
	class CartModel extends Model{
		
				function cartModel(){
						parent::Model();
						$this->load->database();
					}
				function update_cart($cart_id,$data2){
						$this->db->where('shopid',$cart_id);
						$this->db->update('gaoji_shopcar',$data2);
					
					}
				function insert_cart($tablename,$data){    //ssprint_r($data);
			 $this->db->insert($tablename, $data);
					}
					
				function in_cart($username,$proid){
						$query=$this->db->get_where('gaoji_shopcar',array('username'=>$username,'proid'=>$proid));
						return $query->result();
					}
					
				function select_cart($username){
						$query=$this->db->get_where('gaoji_shopcar',array( 'username'=>$username,));
						return $query;
						
					}
				function get_proid($username){
					$sql="select proid,nums from gaoji_shopcar where username='$username'";
					//echo $sql;
					$query=$this->db->query($sql);
					$result=$query->result_array();
						
					//print_r($result);exit;
					return $result;
						/*$this->db->select('proid');
						$query=$this->db->get_where('gaoji_shopcar',array('username'=>$username,));
						//$query=$query->result();
							//foreach($query->result() as $row)
							print_r($query->row_array());exit;
						return $row;*/
					}
	}

?>